package com.esint.kafka.controller;

import com.esint.kafka.roles.ProducerOne;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 类
 * @author: 谷明
 * @createDate: 2021/8/14 15:29
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private ProducerOne producerOne;

    @RequestMapping(value = "one", method = RequestMethod.GET)
    public String testOne(){
        System.out.println("测试kafka发送消息");
        for (int i = 0; i < 1000; i++) {
            producerOne.send();
        }
        System.out.println("测试kafka发送消息结束");
        return "Test Over";
    }

}
